var path = require('path'),
  rootPath = path.normalize(__dirname + '/..'),
  env = process.env.NODE_ENV || 'development';
  appid = 'wxb541ec9e1f14f38e',
  secret = '9a54e9db0eceaef14ca2f7376cf975c3',
  shopKey = '1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9';

var apiDomain = 'http://zhenfei.jumpcity.cn';
    
var config = {
  development: {
    root: rootPath,
    app: {
      cn: '开发环境',
      name: 'development'
    },
    options: {
      maxAge: 0
    },
    resourcePath: {
      staticRoot: '',
      wwwRoot: '',
      apiRoot: apiDomain
    },
    getticket: null,
    /*
    {
      noncestr,
      timestamp,
      maxAge,
      ticketStr, 生成 signature 用；sha1(jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW&timestamp=1414587457&url=http://mp.weixin.qq.com?params=value)
      appid,
      errcode,
      errmsg,
      ticket,
      expire_in
    }
     */

    serveToken: null,
    cookieTime: 1000 * 60 * 60 * 24 * 3,
    appid: appid,
    secret: secret,
    shopKey:shopKey,
    port: process.env.PORT || 8001
  },
  test: {
    root: rootPath,
    app: {
      cn: '测试环境',
      name: 'test'
    },
    options: {
      maxAge: '2 days'
    },
    resourcePath: {
      staticRoot: '',
      wwwRoot: '',
      apiRoot: apiDomain
    },
    getticket: null,
    serveToken: null,
    cookieTime: 1000 * 60 * 60 * 24 * 3,
    appid: appid,
    secret: secret,
    shopKey:shopKey,
    port: process.env.PORT || 8001
  },
  production: {
    root: rootPath,
    app: {
      cn: '正式环境',
      name: 'production'
    },
    options: {
      maxAge: '2 days'
    },
    resourcePath: {
      staticRoot: '',
      wwwRoot: '',
      apiRoot: apiDomain
    },
    getticket: null,
    serveToken: null,
    cookieTime: 1000 * 60 * 60 * 24 * 3,
    appid: appid,
    secret: secret,
    shopKey:shopKey,
    port: process.env.PORT || 8001
  }
};
module.exports = config[env];
